<p id="notice"><%= notice %></p>

<p style="text-align:center; font-size:large;">
  <%= @gadget.title %>
</p>

<p style="text-align:left;">
  <%= @gadget.content %>
</p>

<p style="text-align:left;">
  <%= @gadget.categoryid %>
</p>

<p style="text-align:left;">
  <%= @gadget.lastupdatetime %>
</p>

<p style="text-align:left;">
<%if @gadget.author != nil %>
  <%= @gadget.author.name %>  
  <%end%>
</p>


<div style="text-align:right;">
<%= link_to 'Back', gadgets_path %>
</div>

<!--Comments Part-->

<div style="background-image:url(/images/bg-chrome.jpg); text-align:left; height:23px; 
	margin-top:15px; margin-bottom:5px;font-weight:bold;">
	<div style="background-image:url(/images/chrome-arrow.png); height:18px; padding-left: 10px; padding-top: 5px;width:150px;">
	 评 论
	</div>
</div>

<div id="comments">
	<%@gadget.comments.each do |comment|%>
		<div>
			<div style="text-align:left;">
				<%= comment.author_id %>
				<%= comment.created_at %>
			</div>
			<div style="text-align:left;">
				<%= comment.content %>
			</div>
		</div>
	<%end%>
</div>

<!-- Add comments -->
<div style="text-align:left; margin-top:30px">
<% form_for :comment, :url => {:action => 'add_comment', :id => @gadget} do |f| %>
	<table>
		<tr>
			<td colspan=2 style="font-weight:bold;">&nbsp;&nbsp;&nbsp;&nbsp;添加评论：</td>
		</tr>
		<tr>
			<td>昵称：</td>
			<td> <%= f.text_field :author_id, {:style => 'width:450px'} %></td>
		</tr>
		<tr>
			<td>内容：</td>
			<td><%= f.text_area :content, {:style => 'width:450px;height:100px'} %></td>
		</tr>
		<tr>
			<td></td>
			<td><%= f.submit "提交"%></td>
		</tr>
	</table>
<% end %>
</div>
